package cn.dliyy.warehouse.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.springframework.stereotype.Component;

import cn.dliyy.base.bean.IdAI;
import cn.dliyy.base.bean.CountryRegion;

@Component
@Entity
@Table
public class BDealer extends IdAI {// 经销商
  private static final long serialVersionUID = 27681795936665647L;
  @Column
  @Length(max = 127)
  private String name;
  @Column
  @Length(max = 255)
  private String address;
  @Column
  @Length(max = 31)
  private String person;
  @Column
  @Length(max = 63)
  private String email;
  @Column
  @Length(max = 20)
  @Pattern(regexp = "\\d{0,20}")
  private String phone;
  @Column
  @Length(max = 20)
  @Pattern(regexp = "\\d{0,20}")
  private String mobile;
  @Column
  private Boolean used;
  @ManyToOne(cascade = { CascadeType.ALL })
  @JoinColumn(name = "RegionCode")
  private CountryRegion countryRegion;
  @Column
  @Length(max = 3)
  private String type;

  public CountryRegion getCountryRegion() {
    return countryRegion;
  }

  public void setCountryRegion(CountryRegion countryRegion) {
    this.countryRegion = countryRegion;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getPerson() {
    return person;
  }

  public void setPerson(String person) {
    this.person = person;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String getMobile() {
    return mobile;
  }

  public void setMobile(String mobile) {
    this.mobile = mobile;
  }

  public Boolean getUsed() {
    return used;
  }

  public void setUsed(Boolean used) {
    this.used = used;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

}
